/**
 * Created by Methol on 2016/3/23.
 */
$(function () {
    function show() {
        $(".detailed-btn").click(function () {
            $(this).parents().siblings(".list-demo-detailed").fadeIn(600);
        });
        $(".close").click(function () {
            $(this).parents(".list-demo-detailed").fadeOut(600);
        });
    }
	
	function showMoreCss(){
		$(".project-status").hover(function(){
			$(this).find(".list-more-icon").removeClass("hidden");
		},function(){
			$(this).find(".list-more-icon").addClass("hidden");
		});

		$(".list-more-icon").hover(function(){
			$(this).find("i").removeClass("icon-more").addClass("icon-color-more");
		},function(){
			$(this).find("i").removeClass("icon-color-more").addClass("icon-more");
		});
	}
	
	show();
    showMoreCss();

	/**		
    $.ajaxSetup({cache: false});  // 设置ajax请求不走缓存

    $.ajax({
        url: host + "/project/list/hot",
        type: "get",
        dataType: "json",
        xhrFields: {
            withCredentials: true // 确保请求会携带上Cookie
        },
        beforeSend: function (xhr) {
            xhr.setRequestHeader("Content-Type", "application/json"); // 设置请求协议，会触发PreFlight
        },
        success: function (respResult) {
            $("#v_project_hot").html(template('t:v_project_hot', {list: respResult}));
            show();
            showMoreCss();

            function showMoreCss(){
                $(".project-status").hover(function(){
                    $(this).find(".list-more-icon").removeClass("hidden");
                },function(){
                    $(this).find(".list-more-icon").addClass("hidden");
                });

                $(".list-more-icon").hover(function(){
                    $(this).find("i").removeClass("icon-more").addClass("icon-color-more");
                },function(){
                    $(this).find("i").removeClass("icon-color-more").addClass("icon-more");
                });
            }
        },
        error: function (respResult) {
            console.log(respResult);
        }
    });
	**/
});

